package com.xyh.reward_kotlin.response

data class ResultDto<T>(
    var code: Int = 0,            // 状态码，200成功，400失败等
    var msg: String? = null,      // 提示信息
    var data: T? = null           // 返回数据
) {
    companion object {
        fun <T> ok(message: String?, data: T): ResultDto<T> {
            return ResultDto(200, message, data)
        }

        fun <T> fail(code: Int, message: String?): ResultDto<T> {
            return ResultDto(code, message, null)
        }
    }
}
